class Car{
    private String name;
    private int width;
    private int height;
    private int length;
    private double x;
    private double y;
    private double fuel;

    public Car(String name, int width, int height, int length,  double fuel) {
        this.name = name;
        this.width = width;
        this.height = height;
        this.length = length;
        x = y = 0.0;
        this.fuel = fuel;
    }

    public double getX(){
        return x;
    }

    public double getY(){
        return y;
    }

    public double getFuel(){
        return fuel;
    }
    //显示车的型号
    public void putSpec(){
        System.out.println("名称：" + name);
        System.out.println("车宽：" + width + "mm");
        System.out.println("车高：" + height + "mm");
        System.out.println("车长：" + length + "mm");

    }
    //开车
    //向x开车移动dx， 向y方向移动dy
    public boolean move(double dx, double dy){
        double dist = Math.sqrt(dx * dx + dy * dy);
        if(dist > fuel){
            return false;//无法移动 燃料不足
        }
        else{
            fuel -= dist;
            x += dx;
            y += dy;
            return true;//移动结束erssssssssssssssssssssssssss
        }

    }
}

public class Character7 {
    public static void main(String[] args) {
        Car vitz = new Car("位姿", 1660, 1500, 3640, 40.0);
        Car march = new Car("玛驰", 1660, 1522, 3698, 41.0);

        vitz.putSpec();
        System.out.println();
        march.putSpec();
    }
}
